home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / (A)TB / (A)TBJ.ADF / HEX / Hex.doc < prev    next >
Text File  |  1990-12-23  |  18KB  |  510 lines

  1. ---------------------------------------------------------------------
  2.                              #   # ##### #   #
  3.                              #   # #      # #
  4.                              ##### ###     #
  5.                              #   # #      # #
  6.                              #   # ##### #   #
  7. ---------------------------------------------------------------------
  8.  
  9.                       Hex V1.0, Copyright (c) 1990 by
  10.  
  11.                              Nicola Salmoria
  12.                              Via Piemonte 11
  13.                              53100 Siena  ITALY
  14.  
  15.                             All rights reserved.
  16.  
  17.  
  18. You can contact me on:
  19. MC-Link:      +39 6 4180440      my code is MC6489
  20.  
  21. Voice:        +39 577 54164
  22.  
  23. You can try to contact me on FidoNet, but it's unlikely you'll get an
  24. answer, 'cos there's yet no Fido node in Siena. Maybe in the future.
  25.  
  26.  
  27. This program is SHAREWARE. Copy it as much as you can (provided no
  28. charge is made and the archive is left intact). It can be included,
  29. with the same restrictions, in any commercial program without the
  30. written permission of the author.
  31. Contributions will be greatly appreciated and will help me support
  32. Hex in the future as well as develop new programs. Suggested
  33. contribution is $15. Hex development took 4 months. I spent much time
  34. on it, and I'd like to be rewarded for my work.
  35. Keep one thing in mind: I will probably add new features to Hex, but
  36. I will NOT release a new version until I get enough feedback. So you
  37. know what to do.
  38.  
  39.  
  40. IMPORTANT NOTE: Hex has some unique features difficult to understand
  41. or to even know about without reading this doc file. If you're too
  42. lazy to read it all, you should read at least the 'Editing &
  43. keyboard' chapter, plus the explanations of the menu items you don't
  44. understand.
  45.  
  46. WARNING: This program in the wrong hands may be a lethal weapon! Use
  47. at your own risk. Anyway, Hex is provided "AS IS", without warranty
  48. of any kind, either expressed or implied. The author will never be
  49. liable for any loss of data, disk damage, computer explosion,
  50. earthquake, alien invasion, or anything else.
  51.  
  52. REMEMBER: It is both immoral and illegal to modify someone else's
  53. programs and redistribute them. All such changes should be considered
  54. strictly for personal use. If you want to let the rest of the world
  55. know about some nice changes you've devised, I think it may be
  56. considered acceptable to spread a text file explaining what to change
  57. (like I do with keymaps later on).
  58.  
  59.  
  60. --------
  61. Overview
  62. --------
  63.  
  64. Hex is a file-based (as opposed to sector-based, like NewZAP) binary
  65. file editor. This means that the file is loaded in memory all at
  66. once, edited there and saved at the end. There are advantages and
  67. disadvantages in both approaches: sector-based editors depend heavily
  68. on device speed in operations like search; on the other hand, file
  69. based-ones take longer to display the file for the first time, 'cos
  70. they have to load it all. Moreover, file-based editors need more
  71. memory, and it may be impossible to load very large files. Hex uses
  72. the same text routines of MiniView80. This means it's got (one of)
  73. the fastest and smoothest screen rendering ever seen in a file
  74. editor.
  75.  
  76.  
  77. ---------------
  78. Acknowledgement
  79. ---------------
  80.  
  81. I'd like to thank the following people for beta-testing and
  82. suggestions:
  83. Federico Giannici
  84. Marco Ciuchini
  85. Antonio Rossi
  86. Massimiliano Marras
  87. Angelo Mariani
  88.  
  89.  
  90. -------
  91. Loading
  92. -------
  93.  
  94. From WorkBench, double-click on Hex icon. You can use extended
  95. selection: click on Hex icon, then press SHIFT and double-click on
  96. the file icon.
  97.  
  98. From CLI, syntax is:
  99. Hex [filename] [NODETACH]
  100. If you specify a file name, it will be loaded on startup.
  101. By default, Hex detaches from the current CLI. You can disable this
  102. feature with the switch NODETACH. It may be useful if you execute Hex
  103. from one of that nice directory utilities.
  104.  
  105. IMPORTANT NOTE: To load Hex, the file 'req.library' must be in your
  106. LIBS: directory. Req.library is a freely distributable library by
  107. C.W.Fox and Bruce Dawson. If you are a programmer, you may want to
  108. take a look at it. It features the BEST file requester I have ever
  109. seen and many other nice functions.
  110.  
  111.  
  112. -----------
  113. The gadgets
  114. -----------
  115.  
  116. Many hex functions are obtained thru the use of gadgets. Most of them
  117. can be operated also with menus. Of course selecting a menu is less
  118. handy than directly clicking in a gadget; menu operations are there
  119. mostly to provide keyboard shortcuts.
  120.  
  121. Search gadgets:
  122. ---------------
  123. In the 'Search' box there are many gadgets, all obviously related to
  124. the search functions. There are three boxes near to the words
  125. 'Search', 'Hex', 'Text'. Only one of them is selected, and indicates
  126. which search mode is currently active. You can click on them to
  127. quickly change search mode. If a match is found, cursor is placed at
  128. the start of it, and edit mode is changed to the corresponding one.
  129.  
  130. String
  131.          Search for a given string. Click in the string gadget below
  132. and enter the text you want to search for. When you press return,
  133. search will start at cursor position.
  134.  
  135. A=a
  136.          Search can be case sensitive or case unsensitive; you can
  137. switch the flag with this gadget.
  138.  
  139. Hex
  140.          Search for a sequence of bytes you specify via their
  141. hexadecimal notation. Click in the string gadget below and enter the
  142. byte sequence you want to search. You can enter data as xx xx xx,
  143. xxxxxxxx, xxxx xx xxxxxx, anyway you want, provided between two blank
  144. spaces there is an even number of characters.
  145.  
  146. CAL
  147.          Imports in the hex gadget the value currently displayed on
  148. the calculator display. A leading zero is added if needed.
  149.  
  150. Text
  151.          This is a special feature: it searches the file for
  152. occurrencies of at least eight 'good' ASCII characters. It is useful
  153. to quickly locate message strings in a file. When this box is
  154. selected, use 'Continue' to scan the file.
  155.  
  156. Continue
  157.          Continues the search from the new cursor position.
  158.  
  159. << and >>
  160.          Specify the search direction.
  161.  
  162.  
  163. Other gadgets:
  164. --------------
  165. Start and End
  166.          These two behave differently if you are editing a file or
  167. GRABbing memory (see below). In file mode, 'Start' is always zero and
  168. 'End' indicates the last byte of the file (or, if you prefer, the
  169. file length MINUS ONE). In memory mode, they indicate the start and
  170. end of the memory grabbed. You can change the value contained in
  171. these gadgets: the file will be modified accordingly, if possible.
  172. You can enlarge or shrink a file, or change the 'window' on the
  173. memory. To add bytes at the start of the file, simply insert a
  174. negative value. Note that when you change the 'Start' gadget in file
  175. mode, it is reset to zero and the 'End' value is changed accordingly.
  176.          If you press SHIFT-Return in one of the gadgets, the other
  177. one is activated. This is an easy way to change start and end
  178. together. It's main use is to completely change the portion of memory
  179. grabbed.
  180.  
  181. Position
  182.          Reports the position occupied by the cursor in the file.
  183. Modify its value to jump to a specific location.
  184.  
  185. Editing
  186.          Shows which side of the display you are editing: ASCII or
  187. HEX. This gadget exists only in 'Hex/ASCII' display mode, in 'Only
  188. ASCII' it is replaced by 'Value', which reports the hex value of the
  189. byte the cursor is on. You can modify this value, so you don't have
  190. to change the display mode to insert an hex value in the middle of an
  191. ASCII string.
  192.  
  193. UNDO and REDO
  194.          Self explanatory. Hex features a multi-level undo/redo
  195. (currently max undo level is 256).
  196.  
  197.  
  198.  
  199. ---------
  200. The menus
  201. ---------
  202.  
  203. NOTE: I won't repeat it for every function, but every time you do
  204. something which would mean losing the current data, a requester will
  205. appear asking if you want to save the file, continue anyway, or
  206. cancel the operation.
  207.  
  208. Project:
  209. --------
  210. About
  211.          The usual information about the program.
  212.  
  213. New
  214.          Creates a new file. The current file is cleared, and the
  215. gadget 'End' is activated. Type there the size MINUS ONE of the file
  216. you want to create.
  217.  
  218. Open
  219.          Loads a new file. The req.library file requester will pop
  220. up, asking you to select a file to load.
  221.  
  222. Save
  223.          Saves the file. Again the req.library requester will come,
  224. asking the filename with which the file will be saved. If you want to
  225. overwrite the previous version, simply click on OK.
  226.  
  227. GRAB Memory
  228.          WARNING: this function is dedicated to the expert users.
  229. The current file is cleared, and the 'Start' gadget is activated.
  230. Type the start address of the memory you want to grab. If you specify
  231. a valid number, the 'End' gadget wil activate. Type the end address,
  232. and there you go! Hex will try to AllocAbs() the memory you specify:
  233. result of that operation is displayed in the menu bar. If the buffer
  234. couldn't be allocated, the 'Editable file?' flag (see below) is
  235. turned off, just to provide more protection.
  236.          I deliberately don't check if the memory addresses you
  237. specify are locations you are allowed to access. I do so to let you
  238. GRAB portions of memory like system ROMs, expansion ROMs, memory
  239. removed from the system lists, and so on. For example, (my version
  240. of) the A2620 board allocates its ROMs at F80000-F87DEF.
  241.          Please note that not only you can crash your system WRITING
  242. somewhere you shouldn't, but also simply READING some forbidden
  243. locations. Just to give you an idea, on my system locations between
  244. C80000 and DFFFFF must be avoided.
  245.  
  246. Print
  247.          Sends current file to PRT:. If replacement char is '╖', it
  248. is replaced with '.'; char set 'all chars' is not supported, replaced
  249. with 'only printable'.
  250.  
  251. Print marked
  252.          Sends to PRT: the portion of the file between the two mark
  253. positions. It doesn't matter which of the two comes before. Note that
  254. the two marks are always set somewhere - if you don't initialize
  255. them, they will point one to the start and the other to the end of
  256. the file.
  257.  
  258. Iconify
  259.          Iconifies Hex. Memory is freed, buffer purged and screen
  260. closed - and a small window is opened in the WorkBench screen. To
  261. reactivate Hex, press the right button when that window is active.
  262. You can quit definitively with the close gadget.
  263.  
  264. Quit
  265.          Guess what?
  266.  
  267.  
  268. Environment:
  269. ------------
  270. Palette
  271.          Invokes req.library color requester.
  272.  
  273. Display
  274.          Two modes are available: Hex/ASCII which prints 16 bytes per
  275. row, showed in hexadecimal long words and in plain ASCII. Only ASCII
  276. prints 48 bytes per row, only as ASCII characters.
  277.  
  278. Char set
  279.          Selects which characters should be filtered out in the ASCII
  280. dump. 'All chars' means no substitutions are made; 'Only printable'
  281. means only chars $20-$7F and $A0-$FF are showed; 'Only $20-$7F' is
  282. self explanatory.
  283.  
  284. Replacement char
  285.          Specifies the char with which filtered chars are
  286. substituted. Choice is between ' ' (space) ,'.' (full stop) and '╖'
  287. (?? code $B7)
  288.  
  289. Load settings
  290.          Loads current settings from 'hex.config'.
  291.  
  292. Save settings
  293.          Saves current settings to 'hex.config'. On future loadings
  294. of Hex, the saved settings will be automatically re-loaded. Settings
  295. saved are: Palette, Display, Char set, Replacement char,
  296. Backspace=undo, Ignore case, Overwrite NULLs, search mode, Iconify
  297. window position.
  298.  
  299. Default settings
  300.          Uses the built-in settings.
  301.  
  302.  
  303. Edit:
  304. -----
  305. Undo/Redo
  306.          Same as the corresponding gadgets.
  307.  
  308. Backspace = undo?
  309.          Selects if pressing the backspace key (top right of
  310. keyboard) should be the same as selecting Undo (or pressing its
  311. keyboard shortcut).
  312.  
  313. Change file start
  314.          All this item does is activate the 'Start' gadget.
  315.  
  316. Start at cursor pos
  317.          Easy way to make a file begin at the cursor position
  318. (instead of selecting 'Start', and writing there the correct value).
  319.  
  320. Change file end
  321.          Activates the 'End' gadget.
  322.  
  323. End at cursor pos
  324.          Faster way to specify file's end position.
  325.  
  326. Switch edit mode / Change value
  327.          Same as the corresponding gadgets.
  328.  
  329. Overwrite NULLs?
  330.          Specifies if in ASCII edit bytes which are zero can be
  331. modified. When you replace text strings in an executable, e.g. the
  332. names of the menus, it is VERY important the new strings don't exceed
  333. previous lengths. Since C strings are NULL-terminated, when this item
  334. is de-selected, you won't be able to write past the max length
  335. allowed.
  336.  
  337. Editable file?
  338.          If this is not checked, the file cannot be modified in any
  339. way. This flag is turned OFF when you GRAB a portion of memory which
  340. can't be allocated; it's turned ON every time the buffer is clear
  341. (Load, New)
  342.  
  343.  
  344. Search:
  345. -------
  346. Search string
  347.          Activates the 'search string' gadget.
  348.  
  349. Search hex
  350.          Activates the 'search hex' gadget.
  351.  
  352. Search text
  353.          Searches for text, as specified before. To continue search,
  354. you can use 'continue' as well as this item again.
  355.  
  356. Ignore case?
  357.          Switches the case dependancy flag. Equivalent to the 'A=a'
  358. gadget.
  359.  
  360. Direction
  361.          Selects the search direction. Equivalent to the
  362. corresponding gadgets.
  363.  
  364. Continue search
  365.          Repeats last search made. The same as the 'continue' gadget.
  366.  
  367.  
  368. Move:
  369. -----
  370. Top
  371.          Jumps to start of file.
  372.  
  373. Bottom
  374.          Jumps to end of file.
  375.  
  376. Any position
  377.          Activates the 'position' gadget.
  378.  
  379. Mark location n
  380.          Set the mark 'n' to the present cursor position. Marks are
  381. used also by the 'print marked' function.
  382.  
  383. Jump to mark n
  384.          Jumps to mark 'n'. If the mark wasn't set, jump to start/end
  385. of file.
  386.  
  387.  
  388. The calculator
  389. --------------
  390.  
  391. NOTE: on 640x200 screens this feature is not available. NTSC users
  392. should use an interlaced screen.
  393.  
  394. On the top right corner of the screen there is a simple calculator.
  395. It's use is fairly simple, being like any usual calculator. I want to
  396. point out that you can use both the mouse in the intuitive way and
  397. the keyboard. In that case, here are the equivalents to the
  398. not-so-intuitive keys:
  399. .                = +/-
  400. $ or H           = Hex
  401. # or T           = Dec
  402. Del or BackSpace = Clear
  403. Help             = On/Off
  404.  
  405. Moreover, the grey keys on the keypad act as the keys A-F. The same
  406. keys SHIFTed or CAPS LOCKed represent the four operations and the
  407. Hex/Dec gadgets. Note that if you press SHIFT while CAPS LOCK is lit,
  408. you get A-F again.
  409.  
  410. One nice thing to note is that the calculator is a stand-alone task,
  411. separated from the main program; this means it is ALWAYS available,
  412. even when Hex is doing something else like displaying a requester or
  413. loading a file from disk. Another important thing is that the
  414. calculator runs on its own window; so don't panic if when you use it
  415. you lose the menus - just click in the main window and you'll get
  416. them back.
  417.  
  418.  
  419. Moving around
  420. -------------
  421.  
  422. There are many ways to move through the file. Clicking on any valid
  423. position will put the cursor there; if you keep the left button
  424. pressed and move the pointer, the cursor will follow you. If you move
  425. the pointer to the extreme top or bottom of screen, you'll scroll
  426. through the file. Edit mode changes correspondingly to where you
  427. click.
  428.  
  429. To fast reach a known position you can use the Jump command or the
  430. scroll bar on the right of the screen.
  431.  
  432. Using keyboard, cursor keys in combination with shift, alt, ctrl have
  433. many effects. Plain cursor keys move the cursor, and scroll file, in
  434. the intuitive way; shift-up and shift-down move 8 positions at a time
  435. and scroll faster; alt-up and alt-down move one page at a time; any
  436. qualifier together with left/right moves to begin/end of current
  437. line. Ctrl-up and ctrl-down move to start and end of file.
  438.  
  439.  
  440. Editing & keyboard
  441. ------------------
  442.  
  443. In ASCII edit, simply type what you like. Note that Return generates
  444. a LF ($0A), while Enter a CR ($0D). Moreover, SHIFT-Return generates
  445. a NULL. This is very useful to terminate strings without having to
  446. switch to HEX edit. In HEX edit, type couples of hex chars. If you
  447. mistake the first number, SPACE will cancel it. Please note that you
  448. won't see the first number you type: only the full byte is
  449. substituded after you enter the couple of chars.
  450.  
  451. Hex uses RawKeyConvert(), so custom keymaps ARE supported.
  452. There is an exception: while in hex edit, grey keys on the numeric
  453. keypad behave like keys A-F. This allows very fast input of data.
  454. This is the layout of the keypad:
  455.  
  456.        +-----+-----+-----+-----+
  457.        |     |     |     |     |
  458.        |  A  |  B  |  C  |  D  |
  459.        |     |     |     |     |
  460.        +-----+-----+-----+-----+
  461.        |     |     |     |     |
  462.        |  7  |  8  |  9  |  E  |
  463.        |     |     |     |     |
  464.        +-----+-----+-----+-----+
  465.        |     |     |     |     |
  466.        |  4  |  5  |  6  |  F  |
  467.        |     |     |     |     |
  468.        +-----+-----+-----+-----+
  469.        |     |     |     |     |
  470.        |  1  |  2  |  3  |  E  |
  471.        |     |     |     |  n  |
  472.        +-----+-----+-----+  t  |
  473.        |           |     |  e  |
  474.        |     0     |  .  |  r  |
  475.        |           |     |     |
  476.        +-----------+-----+-----+
  477.  
  478. Such feature would be handy also in the input gadgets; however, they
  479. are handled by Intuition, so a keymap is needed. I have provided a
  480. file called 'h', which is a custom keymap you should put in
  481. DEVS:keymaps. However, if you like, you can modify your keymap and
  482. use it with hex or anywhere you like. Here is how to proceed:
  483.  
  484. - Load Hex (this is the least you could expect!).
  485. - OPEN DEVS:keymaps/your_keymap.
  486. - JUMP to 20F. There should be a '-' there.
  487. - Modify the '-' to 'E'.
  488. - JUMP to 24F. This is the top-left key in the keypad.
  489. - Modify it to 'A'.
  490. - Go to 253. Modify to 'B'.
  491. - Go to 257. Modify to 'C'.
  492. - Go to 25B. Modify to 'D'.
  493. - Go to 25F. Modify to 'F'.
  494. - SEARCH for '?~'. After these two chars, there should be the name of
  495.   the keyboard. Replace it with 'h'. If the keymap name is longer
  496.   then one char, remember to put a NULL after h.
  497. - SAVE as DEVS:keymaps/h
  498.  
  499. All done. Hex will automatically load DEVS:keymaps/h on startup.
  500.  
  501.  
  502. Note about requesters
  503. ---------------------
  504.  
  505. You don't need mouse to reply to req.library requesters. There's a
  506. whole range of keys you can use, the easiest to remember are:
  507. L for the left gadget
  508. M for the middle gadget
  509. R for the right gadget
  510.